package com.ruoyi.weiriya.domain;

import java.math.BigDecimal;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseIdEntity;
import com.ruoyi.common.utils.StringUtils;
import lombok.Data;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;

/**
 * 非会员购买设置对象 w_non_vip_setting
 * 
 * @author lynn
 * @date 2023-08-01
 */
@Data
@ApiModel(value = "WNonVipSetting", description = "非会员购买设置对象")
public class WNonVipSetting extends BaseIdEntity
{
    private static final long serialVersionUID = 1L;

    /** id */
    @ApiModelProperty("id")
    private String id;

    /** 小区ID（区域ID） */
    @Excel(name = "小区ID", readConverterExp = "区=域ID")
    @ApiModelProperty("小区ID（区域ID）")
    private String areaId;

    /** 小区名称 */
    @TableField(exist = false)
    @ApiModelProperty("小区名称（区域名称）")
    private String areaName;

    /** 停车每小时所需金额 */
    @Excel(name = "停车每小时所需金额")
    @ApiModelProperty("停车每小时所需金额")
    private Double stopHourAmount = 0D;

    /** 停车每天所需金额 */
    @Excel(name = "停车每天所需金额")
    @ApiModelProperty("停车每天所需金额")
    private Double stopDayAmount = 0D;

    /** 充电每小时所需金额 */
    @Excel(name = "充电每小时所需金额")
    @ApiModelProperty("充电每小时所需金额")
    private Double chargeHourAmount = 0D;

    /** 充电每天所需金额 */
    @Excel(name = "充电每天所需金额")
    @ApiModelProperty("充电每天所需金额")
    private Double chargeDayAmount = 0D;

    /** 创建者 */
    @TableField(fill = FieldFill.INSERT)
    @ApiModelProperty("创建者")
    private String createBy;

    /** 创建时间 */
    @ApiModelProperty("创建时间")
    @TableField(fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /** 更新者 */
    @TableField(fill = FieldFill.UPDATE)
    @ApiModelProperty("更新者")
    private String updateBy;

    /** 更新时间 */
    @ApiModelProperty("更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    public <T> QueryWrapper<T> queryWrapper(){
        QueryWrapper<T> wrapper=new QueryWrapper<>();

        wrapper.like(StringUtils.isNotEmpty(id),"nvs.id" , id);
        wrapper.like(StringUtils.isNotEmpty(areaId),"nvs.area_id" , areaId);
        wrapper.orderByDesc("nvs.create_time");
        return wrapper;
    }

}
